# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=libatasmart
pkgver=0.19
pkgrel=5
pkgdesc="ATA S.M.A.R.T. Reading and Parsing Library"
arch=('x86_64')
license=('LGPL')
depends=('systemd-libs')
makedepends=('systemd')
url="http://0pointer.de/blog/projects/being-smart.html"
source=(http://0pointer.de/public/${pkgname}-${pkgver}.tar.xz
        0001-Dont-test-undefined-bits.patch
        0002-Drop-our-own-many-bad-sectors-heuristic.patch)
sha256sums=('61f0ea345f63d28ab2ff0dc352c22271661b66bf09642db3a4049ac9dbdb0f8d'
            'ab19d6985bb524774607280a2ee62c48de01785660ff5206d80f778b6404188c'
            '9bb5ca3431f76c182c5b076e2db9378d696608c2ff1d53d01e55c530ba293ce1')

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../0001-Dont-test-undefined-bits.patch
  patch -Np1 -i ../0002-Drop-our-own-many-bad-sectors-heuristic.patch
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --sbindir=/usr/bin \
    --disable-static
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}
